package method2;

public class Student extends Person{
    String no ;
    double scoreEn;
    double scoreMath;
    double scoreCh;
    double AverageScore;
    double HighestScore;
    double MinimumScore;

    public Student() {
        no = "";
        scoreEn = 0;
        scoreMath = 0;
        scoreCh = 0;
        AverageScore = 0;
        HighestScore = 0;
        MinimumScore = 0;
    }

    public double aver(){
       AverageScore = (scoreEn + scoreMath + scoreCh)/3;
       return AverageScore;
    }
    public double max(){

        if (scoreEn >scoreMath&&scoreEn>scoreCh) {
            HighestScore = scoreEn;
        } else if (scoreMath>scoreEn&&scoreMath>scoreCh) {
            HighestScore = scoreMath;
        }else {
            HighestScore = scoreCh;
        }


        return HighestScore;
    }

    public double min(){
        if (scoreEn <scoreMath&&scoreEn<scoreCh) {
            MinimumScore = scoreEn;
        } else if (scoreMath<scoreEn&&scoreMath<scoreCh) {
            MinimumScore = scoreMath;
        }else {
            MinimumScore = scoreCh;
        }

        return MinimumScore;
    }


    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public double getScoreEn() {
        return scoreEn;
    }

    public void setScoreEn(double scoreEn) {
        this.scoreEn = scoreEn;
    }

    public double getScoreMath() {
        return scoreMath;
    }

    public void setScoreMath(double scoreMath) {
        this.scoreMath = scoreMath;
    }

    public double getScoreCh() {
        return scoreCh;
    }

    public void setScoreCh(double scoreCh) {
        this.scoreCh = scoreCh;
    }

    @Override
    public String toString() {
        return "Student{" +
                "学号='" + no + '\'' +
                ", 平均分=" + AverageScore +
                ", 最高分=" + HighestScore +
                ", 最低分=" + MinimumScore +
                ", 姓名='" + name + '\'' +
                ", 性别='" + sex + '\'' +
                ", 年龄=" + age +
                '}';
    }
}
